package com.kaishengit.util;

import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;

public class ReflectionUtil {
	@SuppressWarnings("unchecked")
	public static Class<Object> getGenericSuperTypeClass(Class<?> clazz){
		Type typegen = clazz.getGenericSuperclass();
		if(typegen instanceof ParameterizedType){
			Type[] types = ((ParameterizedType)typegen).getActualTypeArguments();
			return (Class<Object>)types[0];
		}
		return Object.class;
	}
}
